Ext.onReady(function(){
    var tabs = new Array();
    var nodeList = Ext.getDom('content').getElementsByTagName('div');
    for (var i = 0; i < nodeList.length; i++) {
	var id = nodeList[i].id;
	if ((id != null) && (id.match('wikitab-'))) {
	    var itemList = Ext.getDom(id).getElementsByTagName('div');
	    var items    = new Array();
	    var show     = 0;

	    for (var j = 0, len2 = itemList.length; j < len2; j++) {
		if (itemList[j].id.match('tab-') && itemList[j].className.match('x-hide-display') && (itemList[j].getAttribute('title') != null)) {
		    var item = itemList[j];
		    if (item.getAttribute('show') != null) {
			show = j;
		    } // if
		    items.push({
			title: item.getAttribute('title'),
			contentEl: item.id
		    });
		} // if
	    } // for

	    tabs.push({
		id: id,
		activeTab: show,
		items: items
	    });
	} // if
    } // for
    
    for (var i=0, len=tabs.length; i<len; i++) {
	new Ext.TabPanel({
	    renderTo: tabs[i].id,
	    activeTab: tabs[i].activeTab,
	    items: tabs[i].items,
	    plain: true,
	    frame: true,
	    defaults:{autoScroll: true}
	});
    } // for
});